首页> 外文OA文献 >Scala for generic programmers Comparing Haskell and Scala support for generic programming
【2h】

Scala for generic programmers Comparing Haskell and Scala support for generic programming

机译:针对通用程序员的Scala比较Haskell和Scala对通用编程的支持

代理获取
本网站仅为用户提供外文OA文献查询和代理获取服务,本网站没有原文。下单后我们将采用程序或人工为您竭诚获取高质量的原文,但由于OA文献来源多样且变更频繁,仍可能出现获取不到、文献不完整或与标题不符等情况,如果获取不到我们将提供退款服务。请知悉。

摘要

Datatype-generic programming (DGP) involves parametrization of programs by the shape of data, in the form of type constructors such as list of. Most approaches to DGP are developed in pure functional programming languages such as Haskell. We argue that the functional object-oriented language Scala is in many ways a better choice. Not only does Scala provide equivalents of all the necessary functional programming features (such as parametric polymorphism, higher-order functions, higher-kinded type operations, and type-and constructor-classes), but it also provides the most useful features of object-oriented languages (such as subtyping, overriding, traditional single inheritance, and multiple inheritance in the form of traits). Common Haskell techniques for DGP can be conveniently replicated in Scala, whereas the extra expressivity provides some important additional benefits in terms of extensibility and reuse. We illustrate this by comparing two simple approaches in Haskell, pointing out their limitations and showing how equivalent approaches in Scala address some of these limitations. Finally, we present three case studies on how to implement in Scala real DGP approaches from the literature: Hinze's Generics for the Masses, Lmmel and Peyton Jones's Scrap your Boilerplate with Class, and Gibbons's Origami Programming. Copyright © 2010 Cambridge University Press.
机译:数据类型通用编程(DGP)涉及通过数据的形状(例如列表的类型构造函数)对程序进行参数化。 DGP的大多数方法都是用纯函数式编程语言(例如Haskell)开发的。我们认为功能性的面向对象语言Scala在许多方面都是更好的选择。 Scala不仅提供所有必需的功能编程功能(例如,参数多态性,高阶函数,更高种类的类型操作以及类型和构造器类)的等效项,而且还提供了对象-的最有用的功能-面向语言(例如,子类型化,覆盖,传统的单继承和特征形式的多继承)。 DGP的常见Haskell技术可以在Scala中方便地复制,而额外的可表达性在可扩展性和重用性方面提供了一些重要的附加好处。我们通过比较Haskell中的两种简单方法,指出它们的局限性并展示Scala中的等效方法如何解决其中的一些局限性来说明这一点。最后,我们从文献中介绍了三个如何在Scala中实现真正的DGP方法的案例研究:Hinze的大众通用语言,Lmmel和Peyton Jones的“用类浪费您的样板”以及Gibbons的折纸编程。版权所有©2010剑桥大学出版社。

著录项

  • 作者

    Oliveira, BCDS; Gibbons, J;

  • 作者单位
  • 年度 2010
  • 总页数
  • 原文格式 PDF
  • 正文语种
  • 中图分类

相似文献

  • 外文文献
  • 中文文献
  • 专利
代理获取

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号